#include <stdio.h>
#include <stdlib.h>
typedef struct ListNode {
    int data;
    struct ListNode *next;
} ListNode;
ListNode *reverse(ListNode *list){
    ListNode *current=list;
    ListNode *left=NULL;
    ListNode *right=current->next;
    while (right!=NULL){
        left=current;
        current=right;
        right=right->next;
        current->next=left;}
    list=current;
    return(list);}
ListNode *combine(ListNode *left, ListNode *right){
    left=reverse(left);
    right=reverse(right);
    ListNode *current=left;
    while (current->next!=NULL){current=current->next;}
    current->next=right;
    return(left);}